package cn.sany.cterminal.common.enumeration;

/**
 * 装载状态
 1：空载
 2：满载
 3：异常
 */
public enum LoadStateEnum {
    NO_LOAD(1, "空载"),
    LOAD(2, "满载"),
    EXCEPTION(3, "异常");

    /**
     * 状态编码
     **/
    private int code;

    /**
     * 状态信息
     **/
    private String msg;


    LoadStateEnum(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
    public static String getMsgByCode(int code){
        for(LoadStateEnum responseEnum : LoadStateEnum.values()) {
            if(responseEnum.getCode() == code){
                return responseEnum.msg;
            }
        }
        return null;
    }
}
